package com.albaba.designpattern.proxy.text_001;

/**
 * @Description: 代理类
 * @Author zx
 * @Date 2025/2/20 11:39
 * @Version 1.0
 */
public class UserDaoProxy implements IUserDao{

    private IUserDao target;

    public UserDaoProxy(IUserDao target) {
        this.target = target;
    }

    @Override
    public void save() {
        System.out.println("开启事务"); // 扩展额外的功能
        target.save();
        System.out.println("提交事务");
    }
}
